package com.heima.admin.controller.v1;

import com.heima.admin.service.AdminUserLoginService;
import com.heima.model.admin.dtos.AdLoginDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.LoginDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
@RequestMapping("/login")
@Slf4j
@Api(tags = "登录相关接口")
public class AdminLoginController {

    @Autowired
    private AdminUserLoginService loginService;

    @PostMapping("/in")
    @ApiOperation(value = "登录接口")
    public ResponseResult login(@RequestBody AdLoginDto loginDto){
        log.info("收到参数：{}",loginDto);
        return loginService.login(loginDto);
    }
}